From: Julian Sparber Date: Tue, 21 Nov 2023 10:29:46 +0000 (+0100) Subject: st/viewport: Set adjustment properties all at once X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~281^2~2^2~288 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=5b8347f90beed97e371a2d3b18dea99a8deeabb0;p=gnome-shell.git st/viewport: Set adjustment properties all at once This ensures that that property changes are notified all at the same time and only after all were set. If we notify too early handlers may act on a "broken" viewport. Part-of: --- diff --git a/src/st/st-viewport.c b/src/st/st-viewport.c index f65c70c48..fa16fdaad 100644 --- a/src/st/st-viewport.c +++ b/src/st/st-viewport.c @@ -309,32 +309,30 @@ st_viewport_allocate (ClutterActor *actor, { double prev_value; - g_object_set (G_OBJECT (priv->vadjustment), - "lower", 0.0, - "upper", MAX (min_height, avail_height), - "page-size", avail_height, - "step-increment", avail_height / 6, - "page-increment", avail_height - avail_height / 6, - NULL); - prev_value = st_adjustment_get_value (priv->vadjustment); - st_adjustment_set_value (priv->vadjustment, prev_value); + + st_adjustment_set_values (priv->vadjustment, + prev_value, + 0.0, + MAX (min_height, avail_height), + avail_height / 6, + avail_height - avail_height / 6, + avail_height); } if (priv->hadjustment) { double prev_value; - g_object_set (G_OBJECT (priv->hadjustment), - "lower", 0.0, - "upper", MAX (min_width, avail_width), - "page-size", avail_width, - "step-increment", avail_width / 6, - "page-increment", avail_width - avail_width / 6, - NULL); - prev_value = st_adjustment_get_value (priv->hadjustment); - st_adjustment_set_value (priv->hadjustment, prev_value); + + st_adjustment_set_values (priv->hadjustment, + prev_value, + 0.0, + MAX (min_width, avail_width), + avail_width / 6, + avail_width - avail_width / 6, + avail_width); } }